import { createApp } from 'vue'
import { createPinia } from 'pinia'

import '@/assets/css/main.css'

import App from './App.vue'
import router from './router'

import 'element-plus/dist/index.css'
import 'maz-ui/css/main.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import SvgIcon from '@/components/svgIcon.vue'
import 'virtual:svg-icons-register'

import MazInput from 'maz-ui/components/MazInput'
import MazPhoneNumberInput from 'maz-ui/components/MazPhoneNumberInput'

import {imgUrlEvent} from '@/utils/imgUrls'

import globalImagePreview from '@/utils/globalImagePreview'

import "video.js/dist/video-js.css";

import i18n from '@/locale/index'

const { t } = i18n.global
window.$t = t

const app = createApp(App)

// 注册全局图片预览插件
app.use(globalImagePreview);

app.config.globalProperties.$imgUrl = imgUrlEvent

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.component('svg-icon', SvgIcon)

app.use(createPinia())



app.use(router)
app.use(i18n)
app.component('MazInput', MazInput)
app.component('MazPhoneNumberInput', MazPhoneNumberInput)

app.mount('#app')
